package com.tm.media;

import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.IntStream;
import java.util.stream.Stream;

/**
 * @Author Ly
 * @Data 2023/3/12 16:40
 * @ClassName TimerTest02
 */
public class TimerTest02 {
    Timer timer;
    public TimerTest02(){
        Date time = getTime();
        System.out.println("指定时间time=" + time);
        timer = new Timer();
        timer.schedule(new TimerTaskTest02(), time);
    }
    public Date getTime(){
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.HOUR_OF_DAY, 14);
        calendar.set(Calendar.MINUTE, 35);
        calendar.set(Calendar.SECOND, 00);
        Date time = calendar.getTime();
        return time;
    }
    public static void asd(int x,int y){
        for (int i = 1; i < y; i++) {
            for (int j = 0; j < y; j++) {
                if(i+j==x&&2*i+4*j==y){
                    System.out.println("鸡子的数量"+i);
                    System.out.println("兔子的数量"+j);
                }
            }
        }
    }
    public static void main(String[] args) {
        new TimerTest02();
    }
public class TimerTaskTest02 extends TimerTask {
    @Override
    public void run() {
        asd(4,10);
        System.out.println("上课");
    }

    }
}
